﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="quan_tri_tai_lieu.ascx.cs" Inherits="Admin_Module_quan_tri_tai_lieu" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<telerik:RadAjaxManager OnAjaxRequest="Ajax_Request" ID="RadAjaxManager1" runat="server" 
    DefaultLoadingPanelID="RadAjaxLoadingPanel1">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="grd" />
            </UpdatedControls>
        </telerik:AjaxSetting>
       
        <telerik:AjaxSetting AjaxControlID="grd">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="grd" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default">
</telerik:RadAjaxLoadingPanel>

<telerik:RadWindowManager OnClientClose="Window_Close" ID="RadWindowManager1" runat="server" >
    <Windows>
        <telerik:RadWindow VisibleStatusbar="false" Width="800px" Height="600px" runat="server" ID="windows1"></telerik:RadWindow>
    </Windows>
</telerik:RadWindowManager>

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">
        function Window_Close() {
            $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
        }
    </script>
</telerik:RadCodeBlock>

<asp:Label runat="server" ID="lblMessage"></asp:Label>

<fieldset>
    <legend>Danh Sách </legend>
   
    
    <a href="/Admin/Form/Document_Add.aspx" >Thêm Mới</a>
    
    <telerik:RadGrid  AllowFilteringByColumn="True" Skin="WebBlue" GridLines="Horizontal"  AutoGenerateColumns="false" ID="grd" runat="server">
        <MasterTableView>
            <Columns>
                <telerik:GridTemplateColumn HeaderText="Tên tài liệu" DataField="DocumentName">
                    <ItemTemplate>
                        <a href="/Admin/Form/Document_Add.aspx?id=<%#DataBinder.Eval(Container.DataItem,"DocumentID")%>">
                            <%# Eval("DocumentName")%>
                        </a>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridBoundColumn HeaderText="Tên Nhóm" DataField="CategoryPageName"></telerik:GridBoundColumn>
                <telerik:GridImageColumn HeaderText="Ảnh" DataImageUrlFields="DocumentImage" DataAlternateTextField="DocumentName" ></telerik:GridImageColumn>
                <telerik:GridBoundColumn HeaderText="Định dạng" DataField="DocumentType"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn HeaderText="Kích thước" DataField="DocumentSize"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn HeaderText="Lượt Xem" DataField="ViewTime"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn HeaderText="Lượt Download" DataField="DownloadTime"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn HeaderText="Thứ tự" DataField="ViewOrder"></telerik:GridBoundColumn>
                <telerik:GridTemplateColumn AllowFiltering="false" HeaderText="Xóa" >
                    <ItemStyle Width="20px" />
                    <ItemTemplate>
                        <asp:LinkButton OnClientClick="return ConfirmDelete()" runat="server" ID="btnDelete" CausesValidation="false" CommandArgument='<%# Eval("DocumentID") %>' OnClick="Document_Delete" >Delete</asp:LinkButton>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>
</fieldset>